package com.hkyl.hospital.mapper.custom;

import com.hkyl.hospital.entity.Permission;
import com.hkyl.hospital.entity.Role;
import com.hkyl.hospital.mapper.RoleMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author whd
 * @date 2023/07/08 17:26:50
 */
public interface CustomRoleMapper extends RoleMapper {

    int distributePermissions(@Param("roleId") Integer roleId, @Param("permissionIds") List<Integer> permissions);

    //查询一个人的权限
    Role selectOneWithPermissions(Integer roleId);

    List<Integer> selectPermissionByRoleId(Integer roleId);

    Integer removePermissionByRoleId(Integer roleId);


    List<Integer> findRoleIdsByUserId(Integer userId);
}
